import sys
from qtdemo import Weather
from PyQt5.QtWidgets import QApplication, QDialog


class MainDialog(QDialog):
    def __init__(self, parent=None):
        super(QDialog, self).__init__(parent)
        self.ui = Weather.Ui_Dialog()
        self.ui.setupUi(self)

    def queryWeather(self):
        cityName = self.ui.comboBox.currentText()
        weatherMsg = '{}天气真好'.format(cityName)

        self.ui.textEdit.setText(weatherMsg)


    def clearText(self):
        self.ui.textEdit.clear()


if __name__ == '__main__':
    #实例化主窗口
    app = QApplication(sys.argv)
    myDlg = MainDialog()
    myDlg.show()


    sys.exit(app.exec_())